﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace SU.Center.Infa
{
    /// <summary>
    /// 基础仓储接口
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IBaseReposiotry<T> where T : class
    {
        Task<IList<T>> GetAll();
        Task<IList<T>> GetsAll(Expression<Func<T, bool>> where);
        Task<T?> GetAsync(Expression<Func<T, bool>> where);
        Task<int> InsetAsync(T entity);
        Task<int> UpdateAsync(T entity);

        Task<int> DeleteEntity(T entity);
        Task<int> InsertRangeEntity(IList<T> entities);
        Task<int> UpdateRangeEntity(IList<T> entities);
        Task<int> DeleteRangeEntity(IList<T> entities);
    }
}
